package com.nb.cloud.doc.controller;

import cn.hutool.extra.pinyin.PinyinUtil;
import com.nb.cloud.doc.model.Result;
import com.nb.cloud.doc.model.vo.SuggestVO;
import com.nb.cloud.doc.biz.ISuggestBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 搜索 前端控制器
 * </p>
 *
 * @author 作者
 * @since 2024-08-04
 */
@RestController
@RequestMapping("/")
public class SuggestController {

    @Autowired
    ISuggestBiz suggestService;



    @GetMapping("search/suggest")
    public Result<List<SuggestVO>> suggest(String keyword){
        List<SuggestVO> suggestVOList = suggestService.searchSuggest(keyword);
        return Result.OK(suggestVOList);
    }





    public static void main(String[] args) {
        System.out.println(PinyinUtil.getPinyin("一年级",""));
    }
}
